//
//  NetworkTools.swift
//  微博
//
//  Created by 刘静 on 15/10/13.
//  Copyright © 2015年 liujing.cn. All rights reserved.
//

import UIKit
import AFNetworking
class NetworkTools: AFHTTPSessionManager {

    //单例
    
    static let sharedTools:NetworkTools = {
        
        let baseURL = NSURL(string: "https://api.weibo.com/")!
        let tools = NetworkTools(baseURL: baseURL)
    
        return tools
        }()
    //MARK: - OAuth授权
    
    private let clientId = "203044272"
    private let appSecret = "986e722860bd51d4cd45bdd654ab491b"
     let redirectUri = "http://www.baidu.com"
    
    ///返回 OAuth 授权地址
   
    func oauthUrl()->NSURL{
      let urlString = "https://api.weibo.com/oauth2/authorize?client_id=\(clientId)&redirect_uri=\(redirectUri)"
    
        return NSURL(string: urlString)!
    }
}
